Part Number Hot Search : 
ZFMDK10A C5200 P60N06 C5200 MSKW3035 SC473 74HC240 200BZ
Product Description
Full Text Search
 

To Download LK204-24-USB Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  LK204-24-USB t ec hnical man ual re vision: 1.0
contentscontents ii 1 intr oduction 1 1.1 what to expect from the LK204-24-USB . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 what not to expect from the LK204-24-USB . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 k e ypad interf ace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.4 setup for t esting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.5 t rying out the LK204-24-USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.6 t rying out a k e ypad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.6.1 here' s what to do: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 connections 4 2.1 connector pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1.1 po wer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 po wer by 3.5? opp y cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1.3 usb communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.4 alternate usb communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.5 serial ttl communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.6 led headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 general purpose outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2.1 adv anced general purpose outputs & gpo' s 1 to 4 . . . . . . . . . . . . . . . . . 10 2.2.2 adv anced gpo po wer select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.2.3 gpo 5, gpo 6, and gpo 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2.4 dallas 1-w ire bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.3 general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.4 the built in character f ont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.5 writing t e xt to the display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6 t e xt commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6.1 auto line wrap on (254 67)(r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6.2 auto line wrap of f (254 68)(r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6.3 auto scroll on (254 81)(r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6.4 auto scroll of f (254 82)(r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.6.5 set cursor position (254 71 [column][ro w]) . . . . . . . . . . . . . . . . . . . . . 15 2.6.6 send cursor home (254 72) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.6.7 t urn on underline cursor (254 74)(r) . . . . . . . . . . . . . . . . . . . . . . . . 15 2.6.8 t urn of f underline cursor (254 75)(r) . . . . . . . . . . . . . . . . . . . . . . . . 15 2.6.9 t urn on block (blinking) cursor (254 83)(r) . . . . . . . . . . . . . . . . . . . . . 15 2.6.10 t urn of f block (blinking) cursor (254 84)(r) . . . . . . . . . . . . . . . . . . . . . 15 2.6.11 cursor left (254 76) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.6.12 cursor right (254 77) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 matrix orbital LK204-24-USB ii
3 k eypad interface 16 3.1 general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2 connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.3 k e ypad commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3.1 auto repeat mode on (254 126[mode])(r) . . . . . . . . . . . . . . . . . . . . . . 17 3.3.2 auto repeat mode of f (254 96)(r) . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.3 auto t ransmit k e ypresses on (254 65)(r) . . . . . . . . . . . . . . . . . . . . . . 18 3.3.4 auto t ransmit k e ypresses of f (254 79)(r) . . . . . . . . . . . . . . . . . . . . . . 18 3.3.5 clear k e y buf fer (254 69) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.6 poll k e ypad (254 38) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.7 set debounce t ime (254 85 [time])(r) . . . . . . . . . . . . . . . . . . . . . . . . 19 4 bar graphs and special characters 19 4.1 command list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.1.1 initialize w ide v ertical bar graph (254 118) . . . . . . . . . . . . . . . . . . . . . 19 4.1.2 initialize narro w v ertical bar graph (254 115) . . . . . . . . . . . . . . . . . . . . 19 4.1.3 dra w v ertical bar graph (254 61 [column][height]) . . . . . . . . . . . . . . . . . 19 4.1.4 initialize horizontal bar graph (254 104) . . . . . . . . . . . . . . . . . . . . . . . 20 4.1.5 dra w horizontal bar graph (254 124 [column][ro w][dir][len gth ]) . . . . . . . . . . 20 4.1.6 dene custom character (254 78 [c][8 bytes]) . . . . . . . . . . . . . . . . . . . . 20 4.1.7 remember custom character (254 194 [c][8 bytes]) . . . . . . . . . . . . . . . . . 21 5 f an and gpo commands 21 5.1 display return protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2 f an and gpo commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2.1 general purpose output of f (254 86 [gpo #]) . . . . . . . . . . . . . . . . . . . . . 23 5.2.2 general purpose output on (254 87 [gpo #]) . . . . . . . . . . . . . . . . . . . . . 23 5.2.3 pwm v alue (254 192 [f an #] [pwm v alue]) . . . . . . . . . . . . . . . . . . . . . . 23 5.2.4 return f an rpm (254 193 [f an #]) . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2.5 remember gpo / pwm state (254 195 [f an #] [pwm v alue]) . . . . . . . . . . . . 24 5.2.6 set pwm base frequenc y (254 196 [inde x]) . . . . . . . . . . . . . . . . . . . . . 24 5.2.7 remember pwm base frequenc y (254 197 [inde x]) . . . . . . . . . . . . . . . . . 25 6 1-w ir e commands 25 6.1 de vice identication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.2 protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 6.3 r om commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.4 display 1-w ire functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 6.4.1 t ransaction command (254 c8 1 [ags] [send bits] [recie v e bits] [send data]) . . . 27 6.4.2 search command (254 c8 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 7 miscellaneous commands 28 7.1 command list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 7.1.1 remember (254 147 [0|1]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7.1.2 clear display (254 88) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7.1.3 set contrast (254 80 [contrast]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 7.1.4 set contrast and sa v e (254 145[contrast]) . . . . . . . . . . . . . . . . . . . . . . . 29 matrix orbital LK204-24-USB iii
7.1.5 backlight on (254 66[minutes]) (r) . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.1.6 backlight of f (254 70) (r) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 7.1.7 set backlight brightness (254 153[brightness]) . . . . . . . . . . . . . . . . . . . . 30 7.1.8 set and sa v e backlight brightness (254 152[brightness]) . . . . . . . . . . . . . . . 30 7.1.9 load startup screen (254 64 [40 characters]) . . . . . . . . . . . . . . . . . . . . . 30 7.1.10 read module t ype (254 55) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.1.11 set serial number (254 52 [byte1][byte2]) . . . . . . . . . . . . . . . . . . . . . . 31 7.1.12 read serial number (254 53) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7.1.13 read v ersion number (254 54) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8 a ppendix: command summary 32 8.1 general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.2 issuing commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.3 on numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.3.1 ascii characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 8.4 t e xt commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 8.5 k e ypad interf ace commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 8.6 bar graphs and special characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 8.7 f an and gpo commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 8.8 miscellaneous commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 9 a ppendix: specications and options 41 9.1 specications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 9.2 options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 10 a ppendix: glossary 43 matrix orbital LK204-24-USB i v
1 intr oduction the LK204-24-USB is equipped with the follo wing features;  20 column by 4 line te xt display  built in font with pro vision for up to 8 user dened characters  usb communication or serial ttl communication  use of up to 100 modules on the same usb host  fully b uf fered so that no delays in transmission should e v er be necessary  ability to add a customized splash / start up screen  use of "remember" functions to sa v e settings  softw are controlled contrast  softw are controlled backlight brightness  backlight with congurable time-out setting up to 180 minutes  use of up to a 24 k e y k e ypad with a 10 k e y b uf fer  six general purpose outputs for a v ariety of applications  4 adv anced general purpose outputs  3 lo w po wer general purpose ouputs  horizontal or v ertical bar graphs  po wer and data from one usb cable  extended temperature option  a perfect t to matrix orbital' s pc bay inserts without an y modications  dallas 1-wire bridge 1.1 what to expect fr om the LK204-24-USB the LK204-24-USB is designed as the display unit for an associated controller . the controller may be an ything from a single board, special purpose micro-controller to a pc, depending on the application. this controller is responsible for what is displayed on the screen of the display . the display pro vides a simple command structure which allo ws te xts and bar graphs to be displayed on the screen. t e xt fonts are b uilt in and use standard ascii mapping. pro vision is made for up to 8 user dened characters. the screen is backlit for lo w light situations. backlighting may be turned on or of f under program control. contrast is adjustable to compensate for dif fering lighting conditions and vie wing angles. general purpose outputs allo w the controller to switch up to six electronic or electro-mechanical de vices by issuing commands to the display unit. these can be used for controlling leds, relays, etc. 1.2 what not to expect fr om the LK204-24-USB the display does not include bitmap graphics capability , e xcept that permitted by dening special char - acters. matrix orbital LK204-24-USB 1
1.3 k e ypad interface the k e ypad interf ace tak es ro w / column input and con v erts it it ascii characters, which are deli v ered out the usb port to the associated controller . no te the k e ypad is not used to directly control an y aspect of the operation of the display . the display acts simply as a matrix to serial con v erter . 1.4 setup f or t esting before setting up the application, it is best to test out the display . this is easily done with a pc. the follo wing is a list of requirements for testing;  an a v ailable po wered usb source  usb dri v ers which can be located on matrix orbital' s website and e-cd  t est softw are such as alpha demo or display t uner figure 1: connections for t esting once the abo v e test requirements ha v e been met, the user may proceed with the follo wing steps; 1. refer to the diagram abo v e for the follo wing steps. 2. do wnload or cop y the usb dri v ers into a directory . 3. uncompress the les. the y will be a self e xtracting zip le. 4. connect the usb cable to the display and the computer . 5. w indo ws will gi v e a prompt for dri v ers for a usb , serial de vice. 6. select ?specify location?, and na vigate to the directory the le w as uncompressed to. 7. t est the display . matrix orbital LK204-24-USB 2
1.5 t r ying out the LK204-24-USB the unit should be connected to the usb and the backlight and custom startup screen should come on.  run a pc program such as hyperterm to e xperiment with typing te xt. mak e certain it' s congured to use the correct port. set the baud rate to 19,200 and turn o w control of f. once this is complete, try typing some characters on the k e yboard. the characters should no w appear on the display screen. alpha demo, display t uner or mogd are e xcellent for basic display tests. 1.6 t r ying out a k e ypad since a number of dif ferent k e ypad types can be connected to the display , the results may be a little unpredictable. at this point the user should mak e certain the k e ypad and interf ace w ork, and possibly generate an ascii map for programming needs. the k e ypad interf ace on the display con v erts a ro w / column connection to an ascii character . by def ault, a k e ypress is transmitted as serial data immediately . k e ypad b uf fering can be selected using the appropriate commands. the k e ypad should be a matrix style or momentary switches. it is possible to simulate k e y strok es by shorting out a ro w and column pin. 1.6.1 here' s what to do: 1. the pc should be running a terminal program, such as hyperterm. 2. w ith the display connected to the pc, plug in the k e ypad. if the connector has fe wer pins than the one on the display , centre it as well as possible. no tes  the k e ypad connector must be wired with columns on one side and ro ws on the other side of the center of the connector . if the k e ypad isn' t wired this w ay the user will need to mak e an adapter or re wire the connector to meet this requirement.  the connector is re v ersible. re v ersing the connector will not damage the k e ypad or the display , b ut it will ho we v er , change the ascii character map 3. press a k e y on the k e ypad. an upper case ascii character (a-x) should appear on the pc screen. dif ferent k e ys should generate dif ferent characters. t o e xperiment, re v erse the connector to see if it generates a more logical set of characters. ultimately the program in the controller will ha v e to 'map' these characters to the ones mark ed on the k e ypad, which will lik ely be dif ferent. matrix orbital LK204-24-USB 3
2 connections 2.1 connector pinout refer to the figure belo w for this chapter . figure 2: electrical connections t able 1: connectors & functions connector function 14 pin dual header general purpose outputs and +5v output rx / tx recei v e and t ransmit led outputs 10 pin header k e ypad usb communication / po wer alt. usb alternate usb / po wer header 4 pin white header optional high po wer gpo po wer input matrix orbital LK204-24-USB 4
t able 2: mating connectors connector p art # mate p art # 3 pin white header amp 173979 amp 173977 3 pin red header molex 43009 molex 7879 10 pin dual header molex 42375 man y , e x. molex 70058 rx/tx molex 42375 man y , e x. molex 70058 10 pin header molex 42375 man y , e x. molex 70058 usb molex 67068 standard usb cable alt. usb molex 42375 man y , e x. molex 70058 4 pin white header amp 171825-4 amp 170205-1 2.1.1 p o wer usb high po wer ports can supply 500ma of po wer . lo w po wer de vices, such as un-po wered hubs, can only supply 150ma of po wer . please be sure to observ e the total po wer usage on the display when connected to the usb port. the display will require between 150ma to 250ma depending on the model and the number of gpos being used. t able 3: gpo po wer le v els gpo maximum p o wer +5v lo w po wer 20ma +5v high po wer 1000ma. please note; an unmod- ied usb host can only supply a maximum of 500ma on a high po wer output and only 150ma on lo w po wer . +12v high po wer 1000ma po wer is applied via the usb cable or the alternate usb header . po wer requirement is +5 vdc  0.25v and 180ma minimum. w arnings  when using the alternate usb header , v erify all the cable pin outs before applying po wer . incorrect po wer application may damage the display on one host.  mak e sure the host is capable of supplying all the necessary po wer . add the display po wer requirement and the gpo po wer if used for a total po wer requirement. matrix orbital LK204-24-USB 5
the display has a secondary po wer connector used for high po wer gpos. only if the user is planning on using gpo 4, gpo 5 and gpo 6 as +12v , should the user plug in a unmodied 3.5? opp y po wer cable. figure 3: header t able 4: connector pinout pin description pin 4 +5.0 vdc (normally from pc po wer supply) pin 3 ground pin 2 ground pin 1 +12.0 vdc (normally from pc po wer supply) mak e certain to ha v e suf cient current capacity to handle the desired load. each high po wer gpo can source o v er 750ma. 2.1.2 p o wer b y 3.5? opp y cab le figure 4: jumper locations matrix orbital LK204-24-USB 6
figure 5: jumpers 1 and 2 the display can be po wered by the usb port or by e xternal po wer . soldering jumper 1, and remo ving jumper 2 will allo w for po wer to be supplied e xternally . the adv antage to this is the display will po wer up right a w ay , allo wing f ans to start, for e xample, without w aiting for the os to po wer the display . in addition, if the adv anced gpos are set to the +5v position po wer will be dra wn from e xternal po wer rather than the usb port, thus allo wing higher current dra w . no te jumpers 1 and 2 are on from f actory . 2.1.3 usb comm unications a standard b type usb header is pro vided on the display for usb communication. the usb cable pro- vides po wer and data to the display . there are tw o w ays of communicating to the display . under w indo ws, the user will ha v e direct access to the display dri v ers or create a virtual com port (vcp). w ith the vcp , a ne w com port gets created in w indo ws. under the control panel the user can set all the options for the usb de vice, including speed. w indo ws 98, w indo ws me, w indo ws 2000, and w indo ws xp dri v ers ha v e been tested and w ork. vcp dri v ers are also a v ailable for apple os-x, os-8, and os-9. linux dri v ers are a v ailable as well, b ut ha v e not been tested by us, nor will matrix orbital be able to pro vide an y support for them. f or more information please visit 
   8bit, no parity , one stop bit. speed: 19.2 kb/s. t able 5: usb id vid 0403 pid description f a00 usb 2 serial communication f a01 mx2 / mx3 f a02 mx4 / mx5 f a03 lk / vk202-24-usb f a04 lk / vk204-24-usb matrix orbital LK204-24-USB 7
2.1.4 alternate usb comm unications figure 6: usb & alternate usb t able 6: connector pinout pin number description 5 ground 4 not used 3 d+ 2 d- 1 +5v matrix orbital LK204-24-USB 8
2.1.5 serial ttl comm unication figure 7: rx / tx led header the display can also be talk ed to at ttl (logic 0v to +5v) le v els. this will allo w ttl communications through the 4-pin header . communicating by serial ttl will bypass the usb components and po wer will be required to be pro vided by this header . 8bit, no parity , one stop bit. speed: 19.2 kb/s. no te do not po wer or communicate by usb and serial ttl at the same time. 2.1.6 led header s the led headers pro vide a visual indication of communication o v er the rx and tx line if a led is connected. the leds blink frequenc y will increase as the amount of data increases. the headers are current limited to 20ma at +5v . this feature only w orks with usb communication and will not w ork with serial ttl.2.2 general purpose outputs the display has a number of general purpose outputs for a v ariety of applications. matrix orbital LK204-24-USB 9
figure 8: f an header 2.2.1 ad v anced general purpose outputs & gpo' s 1 to 4 these outputs are capable of controlling high current dra w de vices, sa ving po wer up state, being switched to pwm mode, and repeat back rpm via hall ef fect sensor . figure 9: gpos 1 to 4 matrix orbital LK204-24-USB 10
w arnings  rpm reading should not be used at 5v  there are no current limiting resistors  maximum current dra w is 1000ma  as of firmw are re vision 1.1, the def ault pwm frequenc y is 19.1hz  def ault v oltage setting is 12v 2.2.2 ad v anced gpo p o wer select 12 v olt 5 v olt figure 10: high / lo w po wer select when the jumper is placed in the high po wer position, the unit supplies +12v to the adv anced gpos. if the jumper is placed in the lo w po wer position +5v is supplied to the gpos. f or 12v , e xternal po wer supplied by a 3.5? opp y connector will be required. matrix orbital LK204-24-USB 11
2.2.3 gpo 5, gpo 6, and gpo 7 figure 11: general purpose outputs gpo' s 5, 6, and 7 are lo w po wer ouputs pro viding +5v at 20ma enforced by a current limiting resistors. the y are ideal for dri ving leds and relays directly . 2.2.4 dallas 1-wire bridg e the display of fers one dallas 1-wire bridge. all 6 headers are inter -connected to one communication line. a maximum of 32 1-wire de vices can be connected to the display at a time. figure 12: 1-w ire pinout 2.3 general t e xt is displayed on the LK204-24-USB using the b uilt in 5x8 dot matrix font, in addition to up to 8 user dened characters. matrix orbital LK204-24-USB 12
2.4 the built in character font the display includes a b uilt in 5x8 dot matrix font with the full range of ascii characters plus a v ariety of e xtended characters, as sho wn in the figure belo w . figure 13: character set in addition to the b uilt in characters, users may dene up to 8 special characters, which once dened, occup y positions 0x00 to 0x07 in the abo v e chart. the display does not ha v e pro vision to do wnload other fonts. matrix orbital LK204-24-USB 13
2.5 writing t e xt to the displa y when the display recei v es a character , it displays that character at the position currently dened. the ne xt character sent to the module then adv ances to the follo wing position on the display . characters are dra wn using the b uilt in font, and only characters dened in the font are actually displayed. characters which are not dened by the b uilt in font print as a space. the position where te xt is to be inserted is a character location stored in the display' s v olatile memory and maintained internally by the display' s rmw are. this position is manipulated by the commands sho wn in the follo wing section. 2.6 t e xt commands in this section commands are identied by their names and decimal v alues. some commands mark ed with an ?r?, may be remembered? to set ne w def aults that will be in ef fect each time the unit is po wered on. 2.6.1 a uto line wrap on (254 67)(r) enables automatic line wrapping. note that this w ord is not 'w ord wrapping' and wraps may occur in the middle of a w ord. 2.6.2 a uto line wrap off (254 68)(r) disables automatic line wrapping. characters be yond the end of a line may be lost. 2.6.3 a uto scr oll on (254 81)(r) when auto scrolling is on, it causes the display to shift the entire display' s contents up to mak e room for a ne w line of te xt when the te xt reaches the scroll position, which is the bottom right character position. 2.6.4 a uto scr oll off (254 82)(r) when auto scrolling is disabled, te xt will wrap to the top left corner of the display area. existing te xt in the display area is not erased before the ne w te xt is placed. a series of ' spaces', follo wed by a ?cursor home? command, may be used to erase the top line of te xt. matrix orbital LK204-24-USB 14
2.6.5 set cur sor p osition (254 71 [column][r o w]) this command sets the cursor position (te xt insertion point) to the [column] and [ro w] specied. columns ha v e v alues from 1 to 20 (0x01 to 0x14) and ro ws ha v e v alues of 1 and 2 (0x01 and 0x02). 2.6.6 send cur sor home (254 72) this command mo v es the cursor position (te xt insertion point) to the top left of the display area. 2.6.7 t urn on underline cur sor (254 74)(r) t urns on the underline cursor . the cursor sho ws the current te xt insertion point. both underline and blinking cursors may be turned on or of f independently . the cursor if of f by def ault. 2.6.8 t urn off underline cur sor (254 75)(r) t urns of f the underline cursor . does not af fect the blinking block cursor . 2.6.9 t urn on bloc k (b linking) cur sor (254 83)(r) t urns on the blinking block cursor . the cursor sho ws the current te xt insertion point. both blinking and underline cursors may be turned on or of f independently . the cursor is of f by def ault. 2.6.10 t urn off bloc k (b linking) cur sor (254 84)(r) t urns of f the blinking block cursor . does not af fect the underline cursor . 2.6.11 cur sor left (254 76) mo v es the cursor one position to the left b ut does not erase an y character that may be in that position. note that this command mo v es the te xt insertion point e v en if the cursor is turned of f. no te a ' destructi v e backspace', which erases the character to the left of the original position, may be done by issuing the follo wing sequence: cursor left, space, cursor left. matrix orbital LK204-24-USB 15
2.6.12 cur sor right (254 77) mo v es the cursor one position to the right b ut does not erase an y character that may be in that position. note that this command mo v es the te xt insertion point e v en if the cursor is turned of f. 3 k e ypad interface this chapter describes the k e ypad interf ace and associated commands in detail. 3.1 general the display k e ypad interf ace processes the k e ypad ro w / column matrix into a serial data byte stream. aside from this processing, the k e ypad has no ef fect on the display . t o send k e ystrok es to the display , the y must be routed through the controller . 3.2 connections column 1 column 2 column 3 column 4 column 5 column 6 row 1 row 2 row 3 row 4 figure 14: k e ypad connector the connector is not 'k e yed', so the k e ypad will probably plug in either of tw o w ays. the display will not be damaged by re v ersing the connector . ho we v er , the k e ypad will generate a dif ferent ascii character mapping for each position. if the connector has fe wer than 10 pins it should be centered on pins 6 and 7 of the connector . pins 1 through 6 are columns, and pins 7 through 10 are ro ws. the k e ypad is scanned where v er a k e y is passed; there is no continuous k e y scan. this means that k e ypresses are dealt with immediately without an y appreciable latenc y . this also pre v ents electrical noise which is often caused by continuous k e y scans. no te please note that k e ypads may be laid out in a dif ferent pattern. if this is the case, the user will need to interpret the k e y codes dif ferently . matrix orbital LK204-24-USB 16
t able 7: k e ypad layout columns 1 2 3 4 5 6 1 a b c d e f ro ws 2 g h i j k l 3 m n o p q r 4 s t u v w x no te the k e ypad connector must be wired with columns on one side and ro ws on the other side of the centre of the connector . if the k e ypad isn' t wired this w ay the user will need to mak e an adapter or re wire the connector to meet this requirement. 3.3 k e ypad commands some commands, mark ed with an "r", may be "remembered" to set ne w def aults that will be in ef fect each time the unit is po wered on. 3.3.1 a uto repeat mode on (254 126[mode])(r) [mode]=0x00 gi v es resend k e y code mode [mode]=0x01 gi v es k e y do wn / k e y up code mode t w o modes of auto repeat are a v ailable and are set via the same command. 1. resend k ey mode: this mode is similar to the action of a k e yboard on a pc. in this mode, when a k e y is held do wn, the k e y code is transmitted, immediately follo wed by a 1/2 second delay . 2. k ey do wn / k ey up codes: this code may be used when the typematic parameters of the ?resend k e y code? mode are unacceptable or if the unit is being operated in polled mode. the host system detects the press of a k e y and stimulates an auto repeat inside the host system until the k e y release is detected. in this mode, when a k e y is held do wn, the k e y code is transmitted immediately and no other codes will be sent until the k e y is released. on the release of the k e y , the k e y release code transmitted will be a v alue equal to the k e y do wn code plus 20 he x. f or e xample, if the k e y code associated with k e y ?p?(0x50) is pressed, the release code is ?p?(0x70). matrix orbital LK204-24-USB 17
figure 15: poll t iming 3.3.2 a uto repeat mode off (254 96)(r) this command turns of f the auto repeat mode 3.3.3 a uto t ransmit k e ypresses on (254 65)(r) in this mode, all k e ypresses are sent immediately to the host system without the use of the poll k e ypad command. this is the def ault mode on po wer up. 3.3.4 a uto t ransmit k e ypresses off (254 79)(r) in this mode, up to 10 k e ypresses are b uf fered until the unit is polled by the host system via the poll k e ypad command. issuing this command places the unit in polled mode. 3.3.5 clear k e y buff er (254 69) this command clears an y unread k e ypresses. in a menuing application, if the user presses a k e y which changes the menu conte xt, an y follo wing k e y presses may be inaccurate and can be cleared out of the b uf fer between menu changes to pre v ent jumping around the menu tree. it may also be used to, in ef fect, reset the k e ypad in case the host application resets for whate v er reason. 3.3.6 p oll k e ypad (254 38) the host system must be set up to recei v e the k e y codes. when the display recei v es this command it will immediately return an y unb uf fered k e ypresses which may ha v e not been read already . if there is more than one k e ypress b uf fered, then the high order bit (msb) of this returned k e ycode will be set (1). if this is the only b uf fered k e ypress, then the msb will be reset (0). if there are no b uf fered k e ypresses, then the returned code will be 0x00. please note, in order to mak e use of this command, the ? auto transmit k e ypress? mode should be of f. matrix orbital LK204-24-USB 18
3.3.7 set debounce time (254 85 [time])(r) this command sets the time between k e y press and k e y read. all k e y types with the e xception of latched piezo switches will 'bounce' for a v arying time depending on their physical characteristics. the def ault debounce time for the module is about 52 ms, which is adequate for most membrane k e ypads. 4 bar graphs and special character s the display includes the ability to dra w bar graphs (either horizontal or v ertical) and allo ws users to dene up to eight special characters. eight characters (ascii v alues 0x00 to 0x07) are set aside for use with bar graphs, user dened char - acters, and big numbers. since the same 8 characters are used for each function, the functions may not be used simultaneously . the characters may be dened or redened at an y time by issuing the commands sho wn in this section. once dened, the y may be used either by means of the bar graph commands, or by simply issuing one of the ascii v alues 0x00 to 0x07, which is not prex ed by the command byte, 254. 4.1 command list 4.1.1 initializ e wide v er tical bar graph (254 118) this command denes the 8 special / user characters to be blocks suitable for use in dra wing wide (5 pix el) v ertical bar graphs. an y pre viously e xisting denitions will be lost. once this command has been issued, an y number of v ertical bar graphs may be dra wn unless the characters are redened by another command.4.1.2 initializ e narr o w v er tical bar graph (254 115) this command denes the 8 special / user characters to be blocks suitable for use in dra wing narro w (2 pix el) v ertical bar graphs. an y pre viously e xisting denitions will be lost. once this command has been issued, an y number of v ertical bar graphs may be dra wn unless the characters are redened by another command.4.1.3 dra w v er tical bar graph (254 61 [column][height]) dra ws a v ertical bar graph in [column] ha ving a height of [height] pix els. the height may range from 0 to 20 (0x00 to 0x14) pix els. the necessary characters must rst be initialized by either of the commands sho wn in section 4.1.1 or 4.1.2, which will determine the width of the bar graph. the graph may be erased by dra wing a bar graph of height=0 in the same column. matrix orbital LK204-24-USB 19
4.1.4 initializ e horizontal bar graph (254 104) this command denes the 8 special / user characters to be blocks suitable for use in dra wing horizontal bar graphs. an y pre viously e xisting denitions will be lost. once this command has been issued, an y number of horizontal bar graphs may be dra wn unless the characters are redened by another command. 4.1.5 dra w horizontal bar graph (254 124 [column][r o w][dir][length]) dra ws a horizontal bar graph in [ro w] starting at [column] with a length of [length] pix els. [ro w] may ha v e a v alue of 0x01 or 0x02, column may range from 0x01 to 0x14 and length may be from 0x00 to 0x64 (0 to 100) if the graph can e xtend to the full width of the screen. each column is 5 pix els wide (spaces between the columns don' t count). [dir] species the direction: 0x00 goes from left to right, 0x01 goes from right to left. 4.1.6 dene custom character (254 78 [c][8 b ytes]) the display allo ws up to 8 user dened (custom) characters. these characters occup y the rst 8 (0x00 to 0x07) places in the character set. custom characters occup y a 5x8 pix el matrix. built in characters are 5x8; the bottom ro w of pix els is normally reserv ed for the underline cursor . the underline cursor should be turned of f if the bottom ro w of pix els forms part of a custom character . the characters are dened by issuing the command 254 78 [c] follo wed by 8 bytes to dene the character . [c] is the character number (0x00 to 0x07). the 8 bytes are mapped as sho wn in the t able belo w . t able 8: 8 byte map msb lsb * * * 1 2 3 4 5 data byte 1 * * * 6 7 8 9 10 data byte 2 * * * 11 12 13 14 15 data byte 3 * * * 16 17 18 19 20 data byte 4 * * * 21 22 23 24 25 data byte 5 * * * 26 27 28 29 30 data byte 6 * * * 31 32 33 34 35 data byte 7 * * * 36 37 38 39 40 data byte 8 a ?1? bit indicates an ?on? (black) pix el, while a ?0? indicates an ?of f ? (clear) pix el. once dened, a character is displayed simply by issuing a v alue (0x00 to 0x07) corresponding to the character number . the character will be laid out as follo ws; matrix orbital LK204-24-USB 20
t able 9: character v alues 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 no te custom characters will be erased if an y of the ?initialize bar graph? commands are issued. example of a de gree symbol;   !#"$&%  (')  *
+-,/..# 0   !&"1  2    !#"$&%  ('&354637+8,/..# 9
   :  #     !#"   !#"$&%  (')  ));+-,/..# 9<   = #  ?>&&@ 9; a)bdc   !#"$&%  (' ef+8,g..hji&%  ;  k     !#"$&%  (' eh+8,g..  ; l 9
   m #     !#"$&%  (' eh+8,   !#"$&%  (' ef+8,   !#"$&%  (');+-,   !#"$&%  (');+-,   !#"$&%  (');+-,   !#"$&%  (');+-,   !#"$&%  (')  ));+-,/.."  @ %n 9<   m &   ) 4.1.7 remember custom character (254 194 [c][8 b ytes]) this command will store a custom character to be used with the ?custom startup screen?. it does not af fect or alter the current custom characters that are stored in the unit. the syntax is identical to the pre vious command.5 f an and gpo commands 5.1 displa y return pr otocol t o f acilitate the reporting of information other than k e ypresses, the ?display return protocol?, (drp) w as de v eloped. this protocol allo ws the display to return arbitrary information back to the controller . this matrix orbital LK204-24-USB 21
protocol is used for reading f an speeds and retrie ving 1-wire b us information. the basic structure of the protocol is described in the t able belo w . t able 10: display return protocol offset(bytes) length(bytes) v alue description 0 2 0x23 0x2a preamble 2 1 continued / size 3 1 p ack et t ype 4 1?127 p ack et data the rst tw o bytes are the standard preamble to separate the protocol from returned k e ypresses. the ne xt byte is described in the t able belo w . the cont ag species that the data will be continued in the ne xt drp pack et. the lo wer se v en bits contains the size of the data section e xcluding the four byte header . the type species what type of information is contained in the pack et. finally , the data returned is specic to the pack et type. t able 11: continued / size byte bit description 7 continued 6 5 4 3 p ack et size 2 1 0 t able 12: display return protocol t ypes decimal hex ascii description 49 0x31 '1' 1-w ire data 82 0x52 'r' f an rpm data matrix orbital LK204-24-USB 22
5.2 f an and gpo commands 5.2.1 general purpose output off (254 86 [gpo #]) this command turns off an y of the general purpose outputs. [gpo #] is 1 to 6. 5.2.2 general purpose output on (254 87 [gpo #]) this command turns on an y of the general purpose outputs. [gpo #] is 1 to 6. 5.2.3 pwm v alue (254 192 [fan #] [pwm v alue]) this command sets one of the high po wer gpos (gpos 1-4) into pwm mode. this permits speed control of a f an. a pwm v alue of 0 is of f, 128 is 50% po wer , and 255 is full po wer . the f an# can be 1 to 3. 5.2.4 return f an rpm (254 193 [fan #]) this command will return a pack et to the host with the f an rpm contained in it. the structure of the f an is described in the t able belo w . t able 13: return rpm structure offset size description 0 2 0x232a 2 1 0x03 3 1 0x52 4 1 f an # 5 2 f an period (msb rst) t o con v ert the f an period into an rpm v alue, follo w the follo wing formula; rpm = 18750000 x  n where x is the f an period, and n is the number of ticks that the f an produces per period. the number of ticks is usually 1, 2 or 4. f or unkno wn f ans some e xperimentation is required. no te it is not recommended that the rpm is check ed more than once e v ery tw o seconds. if the rpm is check ed more frequently , the actual rpm readings can become v ery erratic. matrix orbital LK204-24-USB 23
5.2.5 remember gpo / pwm state (254 195 [fan #] [pwm v alue]) this command will set the startup state for all the gpos. when the de vice is po wered up the ne xt time, the gpos will be set to the v alues from this command. f or gpos 1 to 4 it beha v es e xactly as the pwm v alue command. f or gpos 5 to 7, a non-zero v alue for the pwm v alue mak e the gpo on for future startups. a pwm v alue of 0 will result in the gpo being of f. this command does not af fect the current state of the gpos or f ans, just po wer up. 5.2.6 set pwm base frequenc y (254 196 [inde x]) no te this command w as added in firmw are v ersion 1.1. it is not present in pre vious v ersions. this command sets the base frequenc y for the pwm modulation. the inde x selects a present frequenc y as sho wn in the follo wing t able. t able 14: pwm base frequencies index fr equency steps 0 0.3 hz 256 1 0.6 hz 256 2 1.2 hz 256 3 2.4 hz 256 4 4.8 hz 256 5 9.6 hz 256 6 19.1 hz 256 7 38.2 hz 256 8 76.3 hz 256 9 152.6 hz 129 10 305.2 hz 65 11 610.4 hz 33 12 1220.7 hz 17 13 2441.4 hz 9 14 4882.9 hz 5 15 9765.8 hz 3 as the frequenc y increases,the number of v alid pwm states will decrease. f or e xample, with an inde x of 14, there are only 5 pwm states. matrix orbital LK204-24-USB 24
t able 15: example pwm v alues for inde x = 14 input pwm actual pwm 0 0 1 -63 25% 64 -127 50% 128- 191 75% 192- 255 100% frequencies in the range of 9.6hz to 38.2hz are desirable for f an control as the y minimize the noise due to pwm modulation. f or visual applications such as controlling cold cathode lights, pwm frequencies of 76.3hz to 305.2hz are desirable to minimize ick er . 5.2.7 remember pwm base frequenc y (254 197 [inde x]) no te this command w as added in firmw are v ersion 1.1. it is not present in pre vious v ersions. this command will set the pwm frequenc y for startup. it does not alter the current pwm base frequenc y . refer to the "set pwm base frequenc y" command for v alid v alues of inde x. 6 1-wire commands the 1-wire b us is capable of communicating with man y de vices o v er a single wire plus a ground refer - ence. this chapter deals with the capabilities of the display and a brief introduction to the 1-w ire standard. f or more detail consult o  7pq   6.1 de vice identication each 1-wire de vice contains a unique 64-bit address in which to identify them with. the address is guaranteed to be unique from an y other de vice, allo wing a virtually unlimited number of de vices on to be attached to the b us. the address itself contains a f amily code and a c yclic redundanc y check (crc). the f amily code is unique to a particular de vice model. f or e xample, the f amily code for the ds18s20 temper - ature probes is 10h. the crc byte is included as a v erication that the correct address w as transmitted or recei v ed. 6.2 pr otocol the transaction sequence for accessing a 1-wire de vice is as follo ws; matrix orbital LK204-24-USB 25
1. reset and detect presence. 2. r om command, follo wed by an y required data e xchange. 3. de vice specic function command, follo wed by an y required data e xchange. before communication can be gin, the b us must be reset to force all de vices to be gin listening. after the reset, all the de vices will transmit a presence pulse which indicates that there is at least one de vice on the b us. once the presence of at least one de vice has been conrmed, the master must select which group of de vices will be in v olv ed in the rest of the transaction. a de vice will use a r om command to determine if the follo wing transaction is intended for it. if not, the de vice will ignore all communication on the b us until the ne xt b us reset. otherwise, the de vice will read and process the rest of the transaction. the nal part of the transaction is the de vice specic function command. t o determine what functions your de vice will respond to, consult the de vices' data sheet. it is v ery important to follo w this sequence for e v ery transaction. if an y of these steps are omitted or performed in the wrong order , the de vices will not respond. none of the de vice addresses are kno wn ahead of time, and as such, each of their address must be searched out and determined. the 1-wire b us pro vides a means of searching the b us for de vices and deter - mining their address. 6.3 r om commands the r om commands allo w a de vice to be singled out for communication or all de vices to be included. this manual only presents the three most used r om commands. f or a more detailed listing and description of all the r om commands, consult the data sheet for the 1-wire de vice being used.  match r om [55h]: t o single out a de vice the match r om command is used. after this command has been issued the 64-bit tar get address is transmitted in lsb to msb order . an y de vice with an address that doesn' t match will ignore all further communication until the ne xt b us reset.  skip r om [cch]: after this command, all de vices will continue to listen and process the transac- tion. this is equi v alent to broadcasting to all de vices. this command is useful when probes need to be informed to get their measurement ready . w ith this command all the probes can be instructed simultaneously .  read r om [33h]: all de vices will be gin transmitting their address after this command. this com- mand will only succeed when there is one de vice on the b us. when multiple de vices are present, all de vices will be gin transmitting their addresses, o v erlapping each other . this command can be used to determine if there is more than one de vice on the b us. after the address has been read back, if the crc is v alid, there is only one de vice on the b us. otherwise there are multiple de vices on the b us and each address must be searched out. 6.4 displa y 1-wire functions the transaction command allo ws data to be put onto the b us and read of f the b us for transactions. and the search command identies all the de vices on the b us for further communication. matrix orbital LK204-24-USB 26
6.4.1 t ransaction command (254 c8 1 [a gs] [send bits] [recie ve bits] [send data]) the transaction command will perform a single transaction on the 1-wire b us in this order; 1. bus reset. 2. t ransmit data onto the b us. 3. recei v e data from the b us. t able 16: 1-w ire t ransaction offset(bytes) length(bytes) name description 0 1 flags the ag byte controls the optional components of the transaction. 1 1 send bits the number of bits that will be transmitted onto the b us. the actual bits to be transmitted are held in the send data section. 2 1 recie v e bits the number of bits to read of f the b us after the data to be put on the b us has been sent. 3 v ariable send data the data to be transmitted onto the b us. the data is transmitted msb to lsb in the order that the y are re- cei v ed. t able 17: 1-w ire flags bit description 7 6 unused 5 (0 for future compatibility) 4 3 add a crc8 to the end of the transmitted data 2 unused (0 for future compatibility) 1 assume last recei v ed byte is a crc8 and v alidate it 0 reset b us before transaction the recei v ed data is sent back using the ?display return protocol?. the return type will be 0x31 or '1', and the error codes are described in the t able belo w . matrix orbital LK204-24-USB 27
t able 18: 1-w ire error codes code description 0x00 success 0x01 unkno wn 1-w ire command 0x02 no de vices on the b us 0x03 f atal search error 6.4.2 sear c h command (254 c8 2) this is used to nd the addresses of all 1-w ire de vices on the b us. after this command the display will return one or more ?display return protocol? pack ets containing either an error code or addresses of 1-wire pack ets. the structure of these pack ets is sho wn in the t able belo w . t able 19: search return p ack et offset(bytes) length(bytes) description 0 2 0x232a - preamble. 2 1 0x8a - p ack et 10 bytes long, an- other address will follo w . 0x0a - p ack et is 10 bytes long, this is the last address. 3 1 0x31 - 1-w ire p ack et t ype 4 1 error code (0x00 for success) 5 8 1-w ire address 13 1 crc8 - 0x00 means the last address w as v alid. 7 miscellaneous commands the commands listed in this chapter don' t readily t in an y of the other cate gories, or are used in more than one cate gory . 7.1 command list some commands, mark ed with an ?r?, may be "remembered" to set ne w def aults that will be in ef fect each time the unit is po wered on. matrix orbital LK204-24-USB 28
7.1.1 remember (254 147 [0|1]) this command allo ws a number of settings, such as cursor state, backlight, etc., to automatically be stored in non-v olatile memory , so the y become ne w def aults. the command should only be used when required for tw o reasons; 1. writing to non-v olatile memory is time consuming and slo ws do wn the operation of the display . 2. non-v olatile memory has a 'write limit' and may only be changed approximately 100,00 times. commands which may be used with the remember function are mark ed with an "r" in the def ault column in the command tables. the e xample sho ws the procedure to set ? auto scroll on? as the def ault condition. commands are sho wn in both decimal and he x in the t able belo w . t able 20: command example decimal hex function 254 147 1 fe 93 01 t urn on ?remember? function 254 81 fe 51 t urn on auto scroll. since ?remem- ber? is on, this setting will be sa v ed in non-v olatile memory 254 147 0 fe 93 00 t urn of f ?remember? function an y number of commands may be entered between the ?remember on?, and ?remember off? com- mands, and all settings will be memorized. 7.1.2 clear displa y (254 88) this command clears the display and resets the te xt insertion point to the top left of the screen. 7.1.3 set contrast (254 80 [contrast]) this command sets the display' s contrast to [contrast], where [contrast] is a v alue between 0x00 and 0xff (between 0 and 255). lo wer v alues cause "on" elements in the display area to appear lighter , while higher v alues cause "on" elements to appear dark er . lighting conditions will af fect the actual v alue used for optimal vie wing. indi vidual display modules will also dif fer slightly from each other in appearance. in addition, v alues for optimal vie wing while the display backlight is on may dif fer from v alues used when the backlight is of f. 7.1.4 set contrast and sa ve (254 145[contrast]) this command w orks in e xactly the same w ay as the "set contrast" command. the only dif ference is that it sa v es the contrast v alue in the non-v olatile memory of the module, whereas the pre vious command matrix orbital LK204-24-USB 29
only changes the v alue until the ne xt po wer do wn. 7.1.5 bac klight on (254 66[min utes]) (r) this command turns on the backlight for a time of [minutes] minutes. if [minutes] is zero (0), the backlight will remain on indenitely . no te the f actory def ault for backlight is on. 7.1.6 bac klight off (254 70) (r) this command turns the display of f. 7.1.7 set bac klight brightness (254 153[brightness]) this command sets the display' s backlight brightness. 7.1.8 set and sa ve bac klight brightness (254 152[brightness]) this command sa v es [brightness] as def ault. 7.1.9 load star tup screen (254 64 [40 c haracter s]) this command sets and memorizes the startup screen which will appear each time the display is turned on. by def ault the screen sho ws; t able 21: def ault screen matrix orbital LK204-24-USB the 80 characters dene the four 20 character ro ws of the screen. matrix orbital LK204-24-USB 30
t able 22: def ault screen character 1 character 20 character 21 character 40 character 41 character 60 character 61 character 80 if sending more then 10 characters to be stored, add in ~10ms per character delay . predened custom characters can be used in the ?startup screen? as well, by using 0x00 through 0x07 characters. 7.1.10 read module t ype (254 55) this command will return the model type v alue of the module as a 1 byte he x v alue. v alues for v arious modules at the time of this publication are as follo ws; t able 23: module v alues lcd0821 - 0x01 lcd2021 - 0x03 lcd2041 - 0x05 lcd4021-0x06 lcd4041 - 0x07 LK204-24-USB - 0x08 lk204-25-0x09 lk404-55 - 0x0a vfd2021 - 0x0b vfd2041 - 0x0c vfd4021 - 0x0d vk202-25 - 0x0e vk204-25 - 0x0f glc12232 - 0x10 glc24064 - 0x13 glk24064-25 - 0x15 glk12232-25 - 0x22 lk404-a t - 0x31 lk402-12 - 0x33 lk162-12 - 0x34 lk204-25pc - 0x35 lk202-24-usb - 0x36 vk202-24-usb - 0x37 LK204-24-USB - 0x38 vk204-24-usb - 0x39 7.1.11 set serial number (254 52 [b yte1][b yte2]) modules may be deli v ered with the serial number blank. in this case the user may set the desired 2 byte serial number using this one time only command. upon the e x ecution of this command, the module will echo these tw o bytes back o v er the rs-232 inter - f ace. the serial number may be set only once. an y future attempt to e x ecute this command will result in no change and the module will return to the originally set serial number . 7.1.12 read serial number (254 53) this command will return a 2 byte he x v alue. matrix orbital LK204-24-USB 31
7.1.13 read v er sion number (254 54) this command will return a 1 byte he x v alue. 8 appendix: command summar y 8.1 general the operation of the LK204-24-USB is controlled by a simple and consistent command set. commands control;  t e xt display  graphic display  k e ypad interf ace  miscellaneous operating parameters this chapter includes summary tables of all commands. 8.2 issuing commands commands are issued to the display by the controller . in a test setup, commands can be issued to the display by means of a b asic program, using the chr$() function. in the tables belo w , commands are sho wn in he x, ascii and decimal form. all commands be gin with the prex character 0xfe (254 decimal). these commands are issued on the serial communications link usb, at the currently dened baud rate. f or e xample (using a b asic setup), the user could issue the command to clear the screen on the display by including the line; rs 4&tLK204-24-USB 32
t able 24: he x v alue t able binary hex decimal binary hex decimal 0000 0 0 1000 8 8 0001 1 1 1001 9 9 0010 2 2 1010 a 10 0011 3 3 1011 b 11 0100 4 4 1100 c 12 0101 5 5 1101 d 13 0110 6 6 1110 e 14 0111 7 7 1111 f 15 based on the table, the byte 01001011 can be represented in he x as 4b, which is usually written as an y of 4bh, 4bh, 4b he x or 0x4b. the numbers can be e xpressed in decimal form if preferred. 8.3.1 ascii character s since computers deal internally with numbers only , b ut e xternally with both letters and numbers, se v eral schemes were de v eloped to 'map' written characters to numeric v alues. one such scheme has become uni v ersal; the american standard code for information interchange, or ascii. ascii tables are readily a v ailable from a number of sources. a fe w e xamples will do here; t able 25: example of an ascii t able the letter a has a v alue of 65 decimal or 41 he x the letter a has a v alue of 97 decimal or 61 he x the number 0 has a v alue of 48 decimal or 30 he x the number 9 has a v alue of 57 decimal or 39 he x this gi v es rise to the possibility of confusion when parameters are being set on the display . f or e xample, the gpo on and off commands use a number to indicate which gpo is being controlled. w e' re told that acceptable v alues are 0 to 6. all such parameters must use numeric v alues (i.e., actual byte v alues). if we send the ascii number by mistak e it will actually gi v e the v alue of 48 decimal (30 he x) to the parameter , which is wrong. in the tables gi v en in the follo wing sections ascii characters are sho wn as 'a ', with single quotes. 8.4 t e xt commands syntax in the tables belo w are gi v en in he x, decimal and decimal with ascii, in that order , one per line. matrix orbital LK204-24-USB 33
no te the letter ?r? in the def ault column indicates that this state can be sa v ed to non- v olatile memory with the ?remember? command. t able 26: t e xt commands command syntax default notes auto line wrap on fe 43 254 67 254 ?c? onr enables line wrapping (not w ord wrap). auto line wrap of f fe 44 254 68 254 ?d? onr disables line wrapping. auto scroll on fe 51 254 81 254 ?q? of f r enables scroll at bottom of screen. t e xt will push display up one line to mak e room for ne w line. auto scroll of f fe 52 254 82 254 ?r? of f r disables auto scroll. t e xt will wrap to top left and o v erwrite e xisting te xt. set cursor position fe 47 [col][ro w] 254 71 [col][ro w] 254 ?g? [col][ro w] n/a mo v es cursor to the specied column and ro w . the cursor marks the te xt insertion point in this and all commands. send cursor home fe 48 254 72 254 ?h? this command mo v es the cursor to the top left of the display area. underline cursor on fe 4a 254 74 254 ?j? of f r t urns on the un- derline cursor . underline cursor of f fe 4b 254 75 254 ?k? r t urns of f the un- derline cursor . block cursor on fe 53 254 83 254 ?s? onr t urns on the blinking block cursor . matrix orbital LK204-24-USB 34
command syntax default notes block cursor of f fe 54 254 84 254 ?t? r t urns of f the blinking block cursor . cursor left fe 4c 254 76 254 ?l ? mo v es the cur - sor one position to the left. if the cursor is already at the be ginning of a line it will mo v e to the end of the other line. cursor right fe 4d 254 77 254 ?m? mo v es the cur - sor one position to the right. if the cursor is already at the end of a line it will mo v e to the be ginning of the other line. 8.5 k e ypad interface commands no te the letter ?r? in the def ault column indicates that this state can be sa v ed to non- v olatile memory with the ?remember? command. t able 28: k e ypad interf ace commands command syntax default notes auto repeat mode on fe 7e [0x00 | 0x01] 254 126 [0|1] 254 ?~?[0|1] of f r applies to k e ypad only . 0x00 = 200 ms typematic, 0x01 = k e y do wn/k e y up codes sent. auto repeat mode of f fe 60 254 96 254 ?`? of f r applies to k e ypad only . matrix orbital LK204-24-USB 35
command syntax default notes auto transmit k e y presses on fe 41 254 65 254 ? a ? onr sets auto transmit mode for k e ypad. k e y presses are transmitted to host without polling. auto transmit k e y presses of f fe 4f 254 79 254 ?o? of f r up to 10 k e y- presses b uf fered until polled. clear k e y b uf fer fe 45 254 69 254 ?e? n/a clear unread k e y- presses. poll k e ypad fe 26 254 38 254 ?&? n/a returns b uf fered k e ypresses to application. re- turns 0x00 if no k e y presses. high order bit set unless this is the last/only k e y press. set debounce time fe 55 [time] 254 85 [time] 254 ?u? [time] 52 ms r resolution: 1 = 0.6554 ms [time] is a numeric mul- tiplier . 8.6 bar graphs and special character s the commands in this section are used to dene and display bar graphs and special characters. t able 30: bar graphs and special characters command syntax notes initialize thick v ertical bar graph fe 76 254 118 254 ?v? initialize the user character set to mak e wide v ertical bar graphs. initialize thin v ertical bar graph fe 73 254 115 254 ?s? initialize the user character set to mak e narro w v ertical bar graphs. initialize horizontal bar graph fe 68 254 104 254 ?h? initialize the user character set to mak e horizontal bar graphs. matrix orbital LK204-24-USB 36
command syntax notes dene custom character fe 4e [c][8 bytes] 254 78 [c][8 bytes] 254 ?n? [c][8 bytes] denes one of 8 custom ?user? char - acters. character number is [c] be- tween 0x00 and 0x07. dra w v ertical bar graph fe 3d [col][length] 254 61 [col][length] 254 ?=?[col][length] dra ws a v ertical bar graph at column [col] of length [length]. length is measured in pix els (0x00 to 0x14). user must rst use the ?v? or ?s? command to initialize characters. dra w horizontal bar graph fe 7c [c][r][d][length] 254 124 [c][r][d][length] 254 ?|? [c][r][d][length] dra ws a horizontal bar graph start- ing at column [c] on ro w [r] with direction [d](0 is right, 1 is left) of length [length]. length is measured in pix els (0x00 to 0x64 if starting in column 1). user must rst use the ?h? command to initialize char - acters. 8.7 f an and gpo commands t able 32: f an and gpo commands command syntax default notes general purpose output of f fe 56 254 86 254 ?v? of f this command turns off an y of the general purpose outputs. [gpo#] is 1 to 6. general purpose output on fe 57 254 87 254 ?w? of f this command turns on an y of the general purpose outputs. [gpo#] is 1 to 6. pwm v alue fe c0 254 192 0 this command sets one of the high po wer gpos (gpos 1-4) into pwm mode. return f an rpm fe c1 254 193 n/a this command will return a pack et to the host with the f an rpm contained in it. matrix orbital LK204-24-USB 37
command syntax default notes remember gpo / pwm state fe c2 254 195 n/a this command will set the start up state for all the gpos. set pwm base frequenc y (ne w in firmw are re vi- sion 1.1) fe c4 [inde x] 254 196 [inde x] 6 this command sets the base frequenc y for the pwm modula- tion. remember pwm base fre- quenc y (ne w in firmw are re vi- sion 1.1) fe c5 [inde x] 254 197 [inde x] 6 this command will set the pwm frequenc y for startup. 8.8 miscellaneous commands no te the letter ?r? in the def ault column indicates that this state can be sa v ed to non- v olatile memory with the ?remember? command. t able 34: miscellaneous commands command syntax default notes remember fe 93 [0|1] 254 147 of f t urns the ?re- member? func- tion on [1] or of f [0]. clear display fe 58 254 88 254 ?x? n/a clears screen of te xt and graphics, places te xt cursor at top left. set contrast fe 50 [contrast] 254 80 [contrast] 254 ?p? [contrast] 0x80128 sets display con- trast. compen- sates for vie wing angle. contrast is a v alue between 0 and 255 (he x 0 to ff). lar ger = dark er . matrix orbital LK204-24-USB 38
command syntax default notes set contrast and sa v e fe 91 [contrast] 254 145 [contrast] 0x80128 same as "set con- trast" b ut sa v es [contrast] as de- f ault. backlight on fe 42 [minutes] 254 66 [minutes] 254 ?b? [minutes] onr backlight will stay on for [min- utes]. if [minutes] = 0 backlight will stay on permanently . backlight of f fe 46 254 70 254 ?f? onr t urns of f back- light. set backlight brightness fe 99 [brightness] 254 153 [brightness] 254 0xff255 sets display back- light brightness. set backlight brightness and sa v e fe 98 [brightness] 254 152 [brightness] 254 0xff255 same as ?set backlight bright- ness? b ut sa v es [brightness] as def ault. load startup screen fe 40 [40 char] 254 64 [40 char] 254 ?@? [40 char] matrix orbital LK204-24-USB loads ne w startup screen (40 char - acters). screen is remembered for subsequent po wer ups. general purpose output of f fe 56 [gpo #] 254 86 [gpo #] 254 ?v? [gpo #] of f t urns a general purpose output off . [gpo #] may be from 1 to 6. general purpose output on fe 57 [gpo #] 254 87 [gpo #] 254 ?w? [gpo #] of f t urns a general purpose output on. [gpo #] may be from 1 to 6. read module type fe 37 254 55 254 ?7? see table reads the module type. matrix orbital LK204-24-USB 39
command syntax default notes set serial number fe 34 [byte1][byte2] 254 52 [byte1][byte2]254 ?4? [byte1][byte2] this is a one- time-use com- mand which w orks only on units without f actory set serial numbers. read serial number fe 35 254 53 254 ?5? reads the tw o byte serial num- bers of the module. read v ersion number fe 36 254 54 254 "6" reads the rmw are v er - sion number of the module. enter o w control mode fe 3a [full][empty] 254 58 [full][empty] 254 ':' [full][empty] of f sets ?full? and ?empty? marks for the 80 byte display b uf fer . when b uf fer reaches [full] display will return 0xfe to host. when b uf fer reaches [empty] display will return oxff . exit o w control mode fe 3b 254 59 254 ';' t urns of f o w control. matrix orbital LK204-24-USB 40
9 appendix: specications and options 9.1 specications t able 36: en vironmental specications standard t emperature operating t emperature 0c to +50c storage t emperature -20c to +70c operating relati v e humidity 90% max non-condensing t able 37: electrical specications supply v oltage 4.75 = vdc supply current 9 ma typical supply backlight current 115 ma typical t able 38: optical characteristics number of characters 40 (20 characters by 2 lines) matrix format 5x8 with underline display area 82.2 x 18.20 mm xxy character size 3.20 x 5.55 mm (xxy), not including underline character pitch 3.7 mm line pitch 5.95 mm dot size 0.60 x 0.65 mm (xxy) dot pitch 0.65 x 0.70 mm (xxy) led backlight life 100, 000 hours typical colour of illumination y ello w green, ice blue, in- v erse blue, in v erse red, in v erse y ello w . matrix orbital LK204-24-USB 41
figure 16: physical layout matrix orbital LK204-24-USB 42
9.2 options t able 39: options a v ailable on the LK204-24-USB in v erse y ello w; black backlight with yello w te xt -iy in v erse blue; blue backlight with white te xt -wb white backlight with gre y glass (ice blue) -gw in v erse red; red backlight with white te xt -r 10 appendix: glossar y t able 40: appendix: glossary ascii american standard code for information interchange. a 7 bit binary code representing the english alpha- bet, decimal numbers and common punctuation marks. also includes control character such as carriage return or end of te xt. an 8 bit superset of the standard ascii codes is often used today to include foreign characters and other symbols. these supersets are often called e xtended ascii character sets. backlight a backlit display is illuminated from behind to pro vide nighttime and impro v ed daytime readability . baudrate the (data and signaling) bit transmission rate of an rs- 232 de vice. binary number a number written using binary notation, which only uses zeros and ones. bit the smallest unit of information a computer can w ork with. each bit is either 0 or 1. binary digit. bitmap a representation, consisting of ro ws and columns of dots, of a graphics image in computer memory . the v alue of each dot (whether it is lled in or not) is stored in one or more bits of data. byte a grouping of eight binary bits. ccfl cold cathode fluorescent lamp. a high brightness backlighting source consists of a uorescent tube po w- ered by a high v oltage a.c. source. matrix orbital LK204-24-USB 43
conguration the w ay a system is set up, or the assortment of com- ponents that mak e up the system. conguration can refer to either hardw are or softw are, or the combina- tion of both. contrast the ratio of luminance between the light state of the display to the dark state of the display . contr oller the micro-controller or pc used to control the matrix orbital display unit. db-9 the designation of a connector used in the rs232 in- terf ace: 9 pin connector firmwar e softw are (programs or data) that has been written onto read-only memory (r om). firmw are is a combina- tion of softw are and hardw are. r oms, pr oms and epr oms and ash eepr oms that ha v e data or pro- grams recorded on them are rmw are. f ont a design for a set of characters. a font is the combina- tion of typef ace and other qualities, such as size, pitch, and spacing. f ont metric a denition of where font is to be placed, such as mar - gins and spacing between characters and lines. hexadecimal refers to the base-16 number system, which consists of 16 unique symbols: the numbers 0 to 9 and the let- ters a to f . f or e xample, the decimal number 15 is represented as f in the he xadecimal numbering sys- tem. the he xadecimal system is useful because it can represent e v ery byte (8 bits) as tw o consecuti v e he x- adecimal digits. it is easier for humans to read he x- adecimal numbers than binary numbers. interface a means by which tw o systems interact. lcd liquid crystal display module t ype v alue this refers to the model number of the module. pixel the smallest indi vidually controllable element of a display . pr e-generated f onts pre-determined fonts which can be do wnloaded into graphic liquid crystal displays. primiti v e a lo w-le v el object or operation from which higher - le v el, more comple x objects and operations can be constructed. in graphics, primiti v es are basic elements, such as lines, curv es, and polygons, which you can combine to create more comple x graphical images. rs-232 short for recommended standard-232c, a standard in- terf ace appro v ed by the electronic industries associa- tion (eia) for connecting serial de vices. matrix orbital LK204-24-USB 44
scr oll t o vie w consecuti v e lines of data on the display screen. the term scroll means that once the screen is full, each ne w line appears at the bottom edge of the screen and all other lines mo v e up one position. serial number a number that is one of a series and is used for identi- cation of the module. serial p ort a port, or interf ace, that can be used for serial commu- nication, in which only 1 bit is transmitted at a time. v ersion number this refers to the rmw are re vision number of the module. v olatile memory t emporary memory . once the po wer supply is turned of f v olatile memory is then erased. matrix orbital LK204-24-USB 45


▲Up To Search▲   

 
Price & Availability of LK204-24-USB

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X